import Vue from "vue";
import VueRouter from "vue-router";
import HomeView from "../views/HomeView.vue";

Vue.use(VueRouter);

const routes = [
  {
    path: "/",
    name: "home",
    component: HomeView,
  },
  {
    path: "/about",
    name: "about",
    // route level code-splitting
    // this generates a separate chunk (about.[hash].js) for this route
    // which is lazy-loaded when the route is visited.
    component: () =>
      import(/* webpackChunkName: "about" */ "../views/AboutView.vue"),
  },
  {
    path: "/mapbox", // mapbox地图
    name: "mapbox",
    component: () => import("../views/openlayers/mapbox.vue"),
  },
  {
    path: "/baidu", // 百度地图
    name: "baidu",
    component: () => import("../views/openlayers/baidu.vue"),
  },
  {
    path: "/arcgis",
    name: "arcgis",
    component: () => import("../views/openlayers/arcgis.vue"),
  },
  {
    path: "/google",
    name: "google",
    component: () => import("../views/openlayers/google.vue"),
  },
  {
    path: "/gaode", // 高德地图
    name: "gaode",
    component: () => import("../views/openlayers/gaode.vue"),
  },
  {
    path: "/bing",
    name: "bing",
    component: () => import("../views/openlayers/bing.vue"),
  },
  {
    path: "/bilichi", // 比例尺控件
    name: "bilichi",
    component: () => import("../views/openlayers/bilichi.vue"),
  },
  {
    path: "/rotate", // 自定义缩放
    name: "rotate",
    component: () => import("../views/openlayers/rotate.vue"),
  },
  {
    path: "/henan", // 河南geojson边界地图
    name: "henan",
    component: () => import("../views/openlayers/henan.vue"),
  },
  {
    path: "/exportJson", // 导出geojson
    name: "exportJson",
    component: () => import("../views/openlayers/exportJson.vue"),
  },
  {
    path: "/canvas", // canvas遮罩
    name: "canvas",
    component: () => import("../views/openlayers/canvas.vue"),
  },
  {
    path: "/mp4", // 点信息视频播放
    name: "mp4",
    component: () => import("../views/openlayers/mp4.vue"),
  },
  {
    path: "/info", // 点信息弹窗
    name: "info",
    component: () => import("../views/openlayers/info.vue"),
  },
  {
    path: "/toggle", // 地图切换
    name: "toggle",
    component: () => import("../views/openlayers/toggle.vue"),
  },
  {
    path: "/boundary", // 边界地图，可编辑
    name: "boundary",
    component: () => import("../views/openlayers/boundary.vue"),
  },
  {
    path: "/hightLight", // geojson边界地图，点击省高亮
    name: "hightLight",
    component: () => import("../views/openlayers/hightLight.vue"),
  },
  {
    path: "/draw", // 画点、线、面
    name: "draw",
    component: () => import("../views/openlayers/draw.vue"),
  },
  {
    path: "/draw1", // 绘制正方形、六芒星星等
    name: "draw1",
    component: () => import("../views/openlayers/draw1.vue"),
  },
  {
    path: "/freedom", // 自由绘制线、面
    name: "freedom",
    component: () => import("../views/openlayers/freedom.vue"),
  },
  {
    path: "/fencing", // 地图跟随点、线、面自动缩放定位
    name: "fencing",
    component: () => import("../views/openlayers/fencing.vue"),
  },
  {
    path: "/pointColor", // svg图表打点
    name: "pointColor",
    component: () => import("../views/openlayers/pointColor.vue"),
  },
  {
    path: "/featureInfo", // 获取绘制图形的信息、坐标、中心点
    name: "featureInfo",
    component: () => import("../views/openlayers/featureInfo.vue"),
  },
  {
    path: "/lineArrowhead", // 显示箭头的线段
    name: "lineArrowhead",
    component: () => import("../views/openlayers/lineArrowhead.vue"),
  },
  {
    path: "/drawArrowhead", // 绘制闪光线段
    name: "drawArrowhead",
    component: () => import("../views/openlayers/drawArrowhead.vue"),
  },
  {
    path: "/measurement", // 测量距离、面积
    name: "measurement",
    component: () => import("../views/openlayers/measurement.vue"),
  },
  {
    path: "/locus", // 轨迹路线图
    name: "locus",
    component: () => import("../views/openlayers/locus.vue"),
  },
  {
    path: "/dragPan", // 拖拽geojson地图
    name: "dragPan",
    component: () => import("../views/openlayers/dragPan.vue"),
  },
  {
    path: "/loading",
    name: "loading",
    component: () => import("../views/openlayers/loading.vue"),
  },
  {
    path: "/position", // 地图搜索定位
    name: "position",
    component: () => import("../views/openlayers/position.vue"),
  },
  {
    path: "/polymerization", // 聚合点
    name: "polymerization",
    component: () => import("../views/openlayers/polymerization.vue"),
  },
  {
    path: "/gif", // 根据feature适配定位地图
    name: "gif",
    component: () => import("../views/openlayers/gif.vue"),
  },
  {
    path: "/markerFeature",
    name: "markerFeature",
    component: () => import("../views/openlayers/markerFeature.vue"),
  },
  {
    path: "/route", // 时间线，拐点标点，起点终点
    name: "route",
    component: () => import("../views/openlayers/route.vue"),
  },
  {
    path: "/fly", // 定位动画
    name: "fly",
    component: () => import("../views/openlayers/fly.vue"),
  },
  {
    path: "/baseCode", // 基础代码
    name: "baseCode",
    component: () => import("../views/openlayers/baseCode.vue"),
  },
  {
    path: "/staticImg", // 加载静态图片
    name: "staticImg",
    component: () => import("../views/openlayers/staticImg.vue"),
  },
  {
    path: "/adddelLayer",
    name: "adddelLayer",
    component: () => import("../views/openlayers/adddelLayer.vue"),
  },
  {
    path: "/webGLPoint", // 海量点 不适用
    name: "webGLPoint",
    component: () => import("../views/openlayers/webGLPoint.vue"),
  },
  {
    path: "/selectBox", // 绘制矩形、停止绘制、查看绘制定位
    name: "selectBox",
    component: () => import("../views/openlayers/selectBox.vue"),
  },
  {
    path: "/coordinate",
    name: "coordinate",
    component: () => import("../views/openlayers/coordinate.vue"),
  },
  {
    path: "/turning", // 绘制多边形，图形顶点图片代替
    name: "turning",
    component: () => import("../views/openlayers/turning.vue"),
  },
  {
    path: "/flashing", // 地图打点Feature闪烁
    name: "flashing",
    component: () => import("../views/openlayers/flashing.vue"),
  },
  {
    path: "/flash1", // 使用Overlay闪烁
    name: "flash1",
    component: () => import("../views/openlayers/flash1.vue"),
  },
  {
    path: "/echarts", // 地图上加载echarts,地图颜色改变
    name: "echarts",
    component: () => import("../views/openlayers/echarts.vue"),
  },
  {
    path: "/echartsFly", // 地图上加载echarts 飞机飞行
    name: "echartsFly",
    component: () => import("../views/openlayers/echartsFly.vue"),
  },
  {
    path: "/movecar", // 地图小车移动
    name: "movecar",
    component: () => import("../views/openlayers/movecar.vue"),
  },
  {
    path: "/antLine", // 蚂蚁轨迹线段
    name: "antLine",
    component: () => import("../views/openlayers/antLine.vue"),
  }
];

const router = new VueRouter({
  mode: "history",
  base: process.env.BASE_URL,
  routes,
});

export default router;
